package com.tanhua.management.utils;

import com.tanhua.common.pojo.Manager;

public class ManagerThreadLocal {

    private static final ThreadLocal<Manager> LOCAL = new ThreadLocal<>();

    private ManagerThreadLocal(){

    }

    /**
     * 将对象放入到ThreadLocal
     *
     * @param manager
     */
    public static void set(Manager manager){
        LOCAL.set(manager);
    }

    /**
     * 返回当前线程中的Manager对象
     *
     * @return
     */
    public static Manager get(){
        return LOCAL.get();
    }

    /**
     * 删除当前线程中的Manager对象
     */
    public static void remove(){
        LOCAL.remove();
    }
}
